// 封装权限设置相关接口
import requset from '@/utils/request'

// 获取权限列表
export function allPermission() {
  return requset({
    url: '/sys/permission'
  })
}

// 添加权限点
export function addPermission(data) {
  return requset({
    method: 'post',
    url: '/sys/permission',
    data
  })
}

// 删除权限
export function delPermission(id) {
  return requset({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

// 根据id获取权限详情
export function getPersonalDetail(id) {
  return requset({
    url: '/sys/permission/' + id
  })
}

// 编辑权限
export function editPermission(data) {
  return requset({
    method: 'put',
    url: '/sys/permission/' + data.id,
    data
  })
}
